package com.mmall.dao;

import com.mmall.pojo.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    Cart selectByUserIdProductId(@Param("userId")int userId,@Param("productId")int productId);

    List<Cart> selectByUserId(int userId);

    int selectCartProductStatusByUserId(int userId);

    int deleteByUserIdProductIds(@Param("userId")int userId,@Param("productList")List productList);

    int selectProductCountByUserId(int userId);

    int selectOrUnSelect(@Param("userId")int userId,@Param("productId")int productId,@Param("checked")int checked);

    List<Cart> selectCheckedByUserId(int userId);
}